import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)
const routes = [
  {
    path:"/index/login",
    redirect:"/"//重定向
},
  
  // {
  //  path:"index/login",
  //  name:"indexlogin",
  //  meta:{
  //   title:"退出"
  //  },
  //  component:()=>import("../views/login.vue"),
  //  redirect:"/",
   
  // },
  {
 path:"/",
 name:"Login",
 meta:{
  title:"登录"
 },
 component:()=>import("../views/login.vue")
  },
 
  {
    path: '/index',
    name: 'index',
   component:()=>import("../views/index.vue"),
   redirect:"/index/dingdan",//访问首页
    children:[
      {
        path:"loopimg",
        name:"Loopimg",
        component:()=>import("../views/shouye/loopimg.vue"),
        meta:{
          title:"轮播图配置"
        }
      },
      {
        path:"hotgoos",
        name:"Hotgoos",
        component:()=>import("../views/shouye/hotgoos.vue"),
        meta:{
          title:"热销商品配置"
        }
      },
      {
        path:"xinpin",
        name:"xinpin",
        component:()=>import("../views/shouye/xinpin.vue"),
        meta:{
          title:"新品上线配置"
        }
      },
      {
        path:"weinitui",
        name:"weinitui",
        component:()=>import("../views/shouye/weinitui.vue"),
        meta:{
          title:"为你推荐配置"
        }
      },
      {
        path:"fenlei",
        name:"fenlei",
        component:()=>import("../views/mulo.vue/fenlei.vue"),
        meta:{
          title:"分类管理"
        }
      },
      {
        path:"shangpin",
        name:"shangpin",
        component:()=>import("../views/mulo.vue/shangpin.vue"),
        meta:{
          title:"商品管理"
        }
      },
      {
        path:"huiyuan",
        name:"huiyuan",
        component:()=>import("../views/mulo.vue/huiyuan.vue"),
        meta:{
          title:"会员管理"
        }
      },
      {
        path:"dingdan",
        name:"dingdan",
        component:()=>import("../views/mulo.vue/dingdan.vue"),
        meta:{
          title:"订单管理"
        }
      },
      {
        path:"xiugai",
        name:"xiugai",
        component:()=>import("../views/xitong/xiugai.vue"),
        meta:{
          title:"修改密码"
        }
      }
    ]
  },
  
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
